<?php

use yii\helpers\Html;
use common\components\ActiveForm;
use yii\helpers\Url;


/* @var $this yii\web\View */
/* @var $model common\models\menu */
/* @var $form yii\widgets\ActiveForm */
?>

<hr/>
<div class="menu-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => 50])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <?= $form->field($model, 'url')->textInput(['maxlength' => 50])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

	<?= $form->field($model, 'icon')->textInput(['maxlength' => 50])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <?= $form->field($model, 'sort')->textInput(['maxlength' => 10, 'value' => 10])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <?= $form->field($model, 'pid')->dropDownList($menu)->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <?= $form->field($model, 'groups')->dropDownList([
		''        => '-选择分组-',
		'sys'     => '系统',
		'article' => '资讯',
		'user'    => '用户'
	])->label(null, [
		'class' => 'col-sm-2 control-label'
	])->hint('选择后表示左侧一级菜单') ?>

	<?= $form->field($model, 'hide')->dropDownList([
		'1' => '隐藏',
		'0' => '显示'
	])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <?= $form->field($model, 'status')->dropDownList([
		'1' => '正常',
		'0' => '禁用'
	])->label(null, [
		'class' => 'col-sm-2 control-label'
	]) ?>

    <div class="form-group">
		<div class="col-xs-2"></div>
        <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success word-btn' : 'btn btn-primary word-btn']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
<script>
	<?php $this->beginBlock('js_end') ?>
	$(function(){
		highlight_subnav("<?= Url::to(['sys/index']) ?>");
	});
	<?php $this->endBlock() ?>
</script>
<?php $this->registerJs($this->blocks['js_end'], \yii\web\View::POS_END) ?>
